package com.toocms.jinjuhang.ui.mine.management_system.withdraw

import androidx.databinding.ObservableField
import androidx.databinding.ObservableInt
import com.toocms.jinjuhang.data.center.WithdrawRecordItemData
import com.toocms.tab.base.BaseViewModel
import com.toocms.tab.base.ItemViewModel

class WithdrawRecordItemModel(
    viewModel: BaseViewModel<*>,
    val item: ObservableField<WithdrawRecordItemData>
) : ItemViewModel<BaseViewModel<*>>(viewModel) {

    val statusTextColorObservableInt by lazy {
        val result: Int = when (item.get()?.status) {
            "0" -> 0xFF999999.toInt() //提现中
            "1" -> 0xFF00B16D.toInt() //已完成
            "2" -> 0xFFFF3333.toInt() //已驳回
            else -> 0xFF999999.toInt()
        }
        ObservableInt(result)
    }
}